#pragma once
#if defined WIN32 || defined _WIN32 || defined __CYGWIN__
#include <windows.h>
#else
#include <stdint.h>
#include <dirent.h>
#ifndef INT64
#define INT64 int64_t
#endif
#endif
#include "gstring.h"
using namespace std;
class FileAttributes
{
public:
	/// <summary>
	/// Constructor
	/// </summary>
	FileAttributes();
	/// <summary>
	/// Is this directory entry a directory?
	/// </summary>
	/// <returns>Returns true if this directory entry is a directory</returns>
	bool IsDirectory();
	/// <summary>
	/// Is this directory entry read only?
	/// </summary>
	/// <returns>Returns true if this directoryo entry is read only</returns>
	bool IsReadOnly();
	/// <summary>
	/// Is this directory entry a hidden file?
	/// </summary>
	/// <returns>Returns true if this directory entry is a hidden file</returns>
	bool IsHidden();
	/// <summary>
	/// Is this directory entry a system file?
	/// </summary>
	/// <returns>Returns true if this directory entry is a system file</returns>
	bool IsSystem();
#if defined WIN32 || defined _WIN32 || defined __CYGWIN__
	/// <summary>
	/// Attributes such as read only, system, directory, hidden.
	/// </summary>
	DWORD dwFileAttributes;
#else
	/// <summary>
	/// From struct dirent.d_type
	/// </summary>
	unsigned char d_type;
#endif
	/// <summary>
	/// Gets the file attributes of a file such as IsDirectory, IsReadOnly, IsHidden and IsSystem
	/// </summary>
	/// <param name="file">The file to get the attributes for</param>
	/// <returns>Returns true if the file exists.</returns>
	bool GetAttributes(const gstring& file);
};

